<?php




	
Route::get('admin/login','Admin\LoginController@index');
Route::post('admin/login','Admin\LoginController@login');

//退出
Route::get('admin/logout','Admin\LoginController@logout');






Route::group(['middleware'=>'auth:admin'],function(){
		

		
		Route::get('/admin/posts','Admin\UserController@posts');

		Route::post('/admin/{post}/store','Admin\UserController@postStore');
		Route::get('admin/index','Admin\IndexController@index');
		Route::get('/admin','Admin\IndexController@index');

    // 当前用户可以更新文章...

		
    // 当前用户可以更新文章...
		
		Route::get('admin/permissions','Admin\UserController@permissions');
		Route::get('admin/users','Admin\UserController@users');
		// admin/users/store
		Route::post('admin/users/store','Admin\UserController@store');
		Route::get('admin/roles','Admin\UserController@roles');
		//create
		Route::get('admin/permissions/create','Admin\UserController@permissionsCreate');
		///  add username password
		Route::get('/admin/users/create','Admin\UserController@usersCreate');

		Route::get('/admin/users/{id}/role','Admin\UserController@roleCreate');
		// post user add role
		Route::post('/admin/users/{user}/store','Admin\UserController@storeRole');
		//post  add  user
		Route::post('/admin/users/{user}/add','Admin\UserController@addUser');
	

		//add role  
		Route::get('/admin/{user}/create','Admin\UserController@rolesCreate');
		

		//update permission
		
		Route::get('/admin/roles/{role}/permission','Admin\UserController@permissionUdate');
		Route::post('/admin/roles/{role}/per','Admin\UserController@per');
		///
		Route::post('/admin/panpan','Admin\UserController@REstore');
		
		Route::post('/admin/pants','Admin\UserController@PEstore');


});
